package com.janko.springbootbase.juc.thread_basic;

/**
 * @Author nyk
 * @Date 2023/2/22 10:13
 * @Version 1.0
 * @Desc 关于SyncronizedExample同步相关的
 */
public class SyncronizedExample {

    /**
     * syncronized锁下、轮播1-10的打印值
     */
    public void func1() {
        synchronized (this) {
            for (int i = 0; i < 10; i++) {
                System.out.println(" " + i);
            }
        }
    }
}
